<?php
	/*
	用户登录接口，登录成功返回该用户JSON数组
	测试方法
	http://localhost/web/api/login.php?account=xxx&password=xxxx
	*/
	include '../includes/common.inc.php';
	
	if(!class_exists('member'))
	{
		include_once MOD_ROOT.'member/includes/member.class.php';
	}
	$member = new member();
	
	
	$cookietime = $remember ? 2592000 : 0; // 保存一月
	$info = $member->login($account, $password, $cookietime);
	if(!$info)
	{
		echo json_encode(array(
			'status'  => false,
			'msg'  => 'Login failed'
			));
	}
	else
	{
		echo json_encode(array(
			'status' => true,
			'data'   => $info,
			'msg'    => 'Login is successful'
		));
	}
	
	
?>